/***
*
* File: wp_vars.nut
* Auth: Damian Wojdat
* Date: 20.10.2012
* Desc: Variables, class declarations, etc.
*
*************************************************************************************************************/

/*
* Functions declaration
*/
function playerDoMessage(playerid, radius, message);
function playerActionMessage(playerid, radius, message);
function sendRadioMessage(playerid, channel, string, color);

/*
* Various variables
*/
class playerData
{
	permsLvl = null;
	para = null;
	adminDuty = null;
	registered = null;
	logged = null;
	name = null;
	icName = null;
	pass = null;
	banned = null;
	warns = null;
	warnCooldown = null;
	vip = null;
	posX = null;
	posY = null;
	posZ = null;
	posAngle = null;
	interior = null;
	crashed = null;
	timeToRespawn = null;
	kills = null;
	totalKills = null;
	deaths = null;
	totalDeaths = null;
	points = null;
	muted = null;
	characterDying = null;
	characterDeath = null;
	health = null;
	armour = null;
	age = null;
	year = null;
	month = null;
	day = null;
	cash = null;
	skin = null;
	sex = null;
	inRelationWith = null;
	relationStatus = null;
	playingHours = null;
	playingHoursHelper = null;
	loginsCount = null;
	allowedPayday = null;
	faction1 = null;
	faction1Rank = null;
	faction2 = null;
	faction2Rank = null;
	testamentType = null;
	testamentFactionID = null;
	testamentPlayerName = null;
	carLic = null;
	boatLic = null;
	heliLic = null;
	weaponLic = null;
	jailed = null;
	jailMin = null;
	jailHour = null;
	jailDay = null;
	jailMonth = null;
	jailYear = null;
	costs = null;
	ticket = null;
	job = null;
	jobTimeChange = null;
	mzgkJobLvl = null;
	mzgkJobPts = null;
	busJobLvl = null;
	busJobPts = null;
	mechanicJobLvl = null;
	mechanicJobPts = null;
	wantedLvl = null;
	item1 = null;
	item1type = null;
	item1option = null;
	item1option2 = null;
	item1option3 = null;
	item1option4 = null;
	item1option5 = null;
	item1option6 = null;
	item2 = null;
	item2type = null;
	item2option = null;
	item2option2 = null;
	item2option3 = null;
	item2option4 = null;
	item2option5 = null;
	item2option6 = null;
	item3 = null;
	item3type = null;
	item3option = null;
	item3option2 = null;
	item3option3 = null;
	item3option4 = null;
	item3option5 = null;
	item3option6 = null;
	item4 = null;
	item4type = null;
	item4option = null;
	item4option2 = null;
	item4option3 = null;
	item4option4 = null;
	item4option5 = null;
	item4option6 = null;
	item5 = null;
	item5type = null;
	item5option = null;
	item5option2 = null;
	item5option3 = null;
	item5option4 = null;
	item5option5 = null;
	item5option6 = null;
	item6 = null;
	item6type = null;
	item6option = null;
	item6option2 = null;
	item6option3 = null;
	item6option4 = null;
	item6option5 = null;
	item6option6 = null;
	item7 = null;
	item7type = null;
	item7option = null;
	item7option2 = null;
	item7option3 = null;
	item7option4 = null;
	item7option5 = null;
	item7option6 = null;
	item8 = null;
	item8type = null;
	item8option = null;
	item8option2 = null;
	item8option3 = null;
	item8option4 = null;
	item8option5 = null;
	item8option6 = null;
	item9 = null;
	item9type = null;
	item9option = null;
	item9option2 = null;
	item9option3 = null;
	item9option4 = null;
	item9option5 = null;
	item9option6 = null;
	item10 = null;
	item10type = null;
	item10option = null;
	item10option2 = null;
	item10option3 = null;
	item10option4 = null;
	item10option5 = null;
	item10option6 = null;
	item11 = null;
	item11type = null;
	item11option = null;
	item11option2 = null;
	item11option3 = null;
	item11option4 = null;
	item11option5 = null;
	item11option6 = null;
	item12 = null;
	item12type = null;
	item12option = null;
	item12option2 = null;
	item12option3 = null;
	item12option4 = null;
	item12option5 = null;
	item12option6 = null;
	item13 = null;
	item13type = null;
	item13option = null;
	item13option2 = null;
	item13option3 = null;
	item13option4 = null;
	item13option5 = null;
	item13option6 = null;
	item14 = null;
	item14type = null;
	item14option = null;
	item14option2 = null;
	item14option3 = null;
	item14option4 = null;
	item14option5 = null;
	item14option6 = null;
	item15 = null;
	item15type = null;
	item15option = null;
	item15option2 = null;
	item15option3 = null;
	item15option4 = null;
	item15option5 = null;
	item15option6 = null;
	constructor()
	{
		permsLvl = 0;
		registered = 0;
		logged = 0;
		name = " ";
		icName = " ";
		pass = " ";
		banned = 0;
		warns = 0;
		warnCooldown = 0;
		vip = 0;
		posX = 0.0;
		posY = 0.0;
		posZ = 0.0;
		posAngle = 0.0;
		interior = 0;
		crashed = 0;
		timeToRespawn = 0;
		kills = 0;
		totalKills = 0;
		deaths = 0;
		totalDeaths = 0;
		points = 0;
		muted = 0;
		characterDying = 0;
		characterDeath = 0;
		health = 0;
		armour = 0;
		age = 0;
		year = 0;
		month = 0;
		day = 0;
		cash = 0;
		skin = 0;
		sex = 0;
		playingHours = 0;
		playingHoursHelper = 0;
		loginsCount = 0;
		allowedPayday = 0;
		faction1 = 0;
		faction1Rank = 0;
		faction2 = 0;
		faction2Rank = 0;
		carLic = 0;
		boatLic = 0;
		heliLic = 0;
		weaponLic = 0;
		jailed = 0;
		jailMin = 0;
		jailHour = 0;
		jailDay = 0;
		jailMonth = 0;
		jailYear = 0;
		costs = 0;
		ticket = 0;
		job = 0;
		jobTimeChange = 0;
		mzgkJobLvl = 0;
		mzgkJobPts = 0;
		busJobLvl = 0;
		busJobPts = 0;
		mechanicJobLvl = 0;
		mechanicJobPts = 0;
		wantedLvl = 0;
		item1 = 0;
		item1type = 0;
		item1option = 0;
		item1option2 = 0;
		item1option3 = 0;
		item1option4 = 0;
		item1option5 = "Puste";
		item1option6 = 0;
		item2 = 0;
		item2type = 0;
		item2option = 0;
		item2option2 = 0;
		item2option3 = 0;
		item2option4 = 0;
		item2option5 = "Puste";
		item2option6 = 0;
		item3 = 0;
		item3type = 0;
		item3option = 0;
		item3option2 = 0;
		item3option3 = 0;
		item3option4 = 0;
		item3option5 = "Puste";
		item3option6 = 0;
		item4 = 0;
		item4type = 0;
		item4option = 0;
		item4option2 = 0;
		item4option3 = 0;
		item4option4 = 0;
		item4option5 = "Puste";
		item4option6 = 0;
		item5 = 0;
		item5type = 0;
		item5option = 0;
		item5option2 = 0;
		item5option3 = 0;
		item5option4 = 0;
		item5option5 = "Puste";
		item5option6 = 0;
		item6 = 0;
		item6type = 0;
		item6option = 0;
		item6option2 = 0;
		item6option3 = 0;
		item6option4 = 0;
		item6option5 = "Puste";
		item6option6 = 0;
		item7 = 0;
		item7type = 0;
		item7option = 0;
		item7option2 = 0;
		item7option3 = 0;
		item7option4 = 0;
		item7option5 = "Puste";
		item7option6 = 0;
		item8 = 0;
		item8type = 0;
		item8option = 0;
		item8option2 = 0;
		item8option3 = 0;
		item8option4 = 0;
		item8option5 = "Puste";
		item8option6 = 0;
		item9 = 0;
		item9type = 0;
		item9option = 0;
		item9option2 = 0;
		item9option3 = 0;
		item9option4 = 0;
		item9option5 = "Puste";
		item9option6 = 0;
		item10 = 0;
		item10type = 0;
		item10option = 0;
		item10option2 = 0;
		item10option3 = 0;
		item10option4 = 0;
		item10option5 = "Puste";
		item10option6 = 0;
		item11 = 0;
		item11type = 0;
		item11option = 0;
		item11option2 = 0;
		item11option3 = 0;
		item11option4 = 0;
		item11option5 = "Puste";
		item11option6 = 0;
		item12 = 0;
		item12type = 0;
		item12option = 0;
		item12option2 = 0;
		item12option3 = 0;
		item12option4 = 0;
		item12option5 = "Puste";
		item12option6 = 0;
		item13 = 0;
		item13type = 0;
		item13option = 0;
		item13option2 = 0;
		item13option3 = 0;
		item13option4 = 0;
		item13option5 = "Puste";
		item13option6 = 0;
		item14 = 0;
		item14type = 0;
		item14option = 0;
		item14option2 = 0;
		item14option3 = 0;
		item14option4 = 0;
		item14option5 = "Puste";
		item14option6 = 0;
		item15 = 0;
		item15type = 0;
		item15option = 0;
		item15option2 = 0;
		item15option3 = 0;
		item15option4 = 0;
		item15option5 = "Puste";
		item15option6 = 0;
	}
}

class vehicleData
{
	id_inGame = null;
	model = null;
	posX = null;
	posY = null;
	posZ = null;
	posAngle = null;
	color1 = null;
	color2 = null;
	color3 = null;
	color4 = null;
	faction1 = null;
	owned = null;
	owner = null;
	price = null;
	engineOn = null;
	serial = null;
	lastDriver = null;
	fuel = null;
	fuelType = null;
	dirtLvl = null;
	locked = null;
	counter = null;
	cb = null;
	cbOn = null;
	cbChannel = null;
	lights = null;
	indicator1 = null;
	indicator2 = null;
	indicator3 = null;
	indicator4 = null;
	sirenState = null;
	constructor()
	{
		id_inGame = -1;
		model = 106;
		posX = 0.0;
		posY = 0.0;
		posZ = 0.0;
		posAngle = 0.0;
		color1 = 0;
		color2 = 0;
		color3 = 0;
		color4 = 0;
		faction1 = 0;
		owned = 0;
		owner = "Brak";
		price = 0;
		engineOn = 0;
		serial = "NY";
		lastDriver = "None";
		fuel = 0;
		fuelType = 0;
		dirtLvl = 0;
		locked = 0;
		counter = 0.0;
		cb = 0;
		cbOn = 0;
		cbChannel = 0;
		lights = false;
		indicator1 = false;
		indicator2 = false;
		indicator3 = false;
		indicator4 = false;
		sirenState = false;
	}
}

pData <- {};															// player data container
bData <- {};															// buildings data container
vehData <- {};														// vehicles data container
fData <- {};																// factions data container
checkpointData <- {};											// checkpoints data container
vehModelsData <- {};											// vehicle models data
buildingCount <- 0;												// how many buildings loaded
vehiclesCount <- 0;												// how many vehicles loaded
factionsCount <- 0;												// how many factions loaded
defaultSpawnData <- {};										// default spawn data
defaultSpawnData.posX <- 0.0;
defaultSpawnData.posY <- 0.0;
defaultSpawnData.posZ <- 0.0;
defaultSpawnData.posA <- 0.0;
defaultSpawnData.cash <- 0.0;
gJustDied <- array(MAX_PLAYERS, 0);			// player just died ?
gGPS <- array(MAX_PLAYERS, 0);					// GPS status
gOOCStatus <- 1;												// OOC status
gLOOCStatus <- 1;												// LOOC status
gIcStatus <- 0;														// IC status
gPWStatus <- 1;													// PW status
sql <- 0;																	// sql connection
gJustDropped <- array(MAX_PLAYERS, 0); 	// item after drop take protection cooldown
gForecast <- 0;													// the ID of predicted weather to be set in some time
gForecastTime <- 0;											// in which time the weather will be set
gSelectedRound <- 0;										// which round is selected
gRoundTimeLeft <- 0;										// how much time till round change
gRoundCount <- 2;												// how many different rounds are avaible
gDefaultRoundTime <- 1200;							// default round time in seconds
gRoundStartTime <- -1;										// time before round time starts
gDefaultRoundStartTime <- 30;						// time in seconds
gScoreBoardForceToggled <- 0;						// force score board to be showed

/*
* Script constants
*/
const MAX_PLAYERS = 32;
const MAX_VEHICLES = 65534;
const MAX_OBJECTS = 65534;
const MAX_NAME = 32;
const INVALID_PLAYER = 2500;
const INVALID_VEHICLE = 5000;
const INVALID_OBJECT = 5000;
const VERSION = "V.0.1.0";

/*
* Mysql constants
*/
const MYSQL_HOST = "";
const MYSQL_USER = "";
const MYSQL_PASS = "";
const MYSQL_DB = "";

const MYSQL_IVMP_BUILDINGS = "ivmp_buildings";
const MYSQL_IVMP_FUELSTATION = "ivmp_fuelstation";
const MYSQL_IVMP_JOBS = "ivmp_jobs";
const MYSQL_IVMP_LOCATIONS_FDEPOT = "ivmp_locations_fdepot";
const MYSQL_IVMP_LOCATIONS_HOSPITALS = "ivmp_locations_hospitals";
const MYSQL_IVMP_LOCATIONS_JOBS = "ivmp_locations_jobs";
const MYSQL_IVMP_LOCATIONS_PD = "ivmp_locations_pd";
const MYSQL_IVMP_USERS = "ivmp_users";
const MYSQL_IVMP_USERS_JOBS = "ivmp_users_jobs";
const MYSQL_IVMP_USERS_ITEMS = "ivmp_users_items";
const MYSQL_IVMP_USERS_HISTORY = "ivmp_users_history";
const MYSQL_IVMP_VEHICLES = "ivmp_vehicles";
const MYSQL_IVMP_VEHICLES_MODELS = "ivmp_vehicles_models";
const MYSQL_IVMP_FACTIONS = "ivmp_factions";

/*
* Color constants
*/
const COLOR_WHITE = 0xFFFFFFAA;
const COLOR_LIGHTYELLOW2 = 0xE0EA64AA;
const COLOR_LIGHTRED = 0xFF6347AA;
const COLOR_ORANGE = 0xFF8000AA;
const COLOR_LIGHTBLUE = 0x33CCFFAA;
const COLOR_YELLOW = 0xFFFF00AA;
const COLOR_BLUE = 0x1300BFAA;
const COLOR_RED = 0xA10000AA;
const COLOR_DARKRED = 0xCD000000;
const COLOR_GREEN = 0x33AA33AA;
const COLOR_PURPLE = 0xC2A2DAAA;
const COLOR_DARKBROWN = 0xB36C42FF;
const COLOR_FADE1 = 0xE6E6E6E6;
const COLOR_FADE2 = 0xC8C8C8C8;
const COLOR_FADE3 = 0xAAAAAAAA;
const COLOR_FADE4 = 0x8C8C8C8C;
const COLOR_FADE5 = 0x6E6E6E6E;
const COLOR_CB = 0x97E9FCFF;
const COLOR_OOC = 0xE0FFFFAA;
const COLOR_AOOC = 0x62B382AA;
const COLOR_LSPD = 0x0000FFAA;

/*
* State types constants
*/
const STATE_TYPE_DISCONNECT = 0;
const STATE_TYPE_CONNECT = 1;
const STATE_TYPE_SPAWN = 2;
const STATE_TYPE_DEATH = 3;
const STATE_TYPE_ONFOOT = 4;
const STATE_TYPE_ENTERCAR = 5;
const STATE_TYPE_INCAR = 6;

/*
* CP types constants
*/
const CP_TYPE_ARROW_TUBE = 2;
const CP_TYPE_FLAG_TUBE = 3;
const CP_TYPE_ARROW_CORONA = 4;
const CP_TYPE_FLAG_CORONA = 5;
const CP_TYPE_ARROW = 6;
const CP_TYPE_FLAG = 7;
const CP_TYPE_CORONA = 8;

/*
* Vehicle names
*/
VehicleNames <- [
"Admiral", "Airtug", "Ambulance", "Banshee", "Benson", "Biff", "Blista Compact", "Bobcat", "Boxville", "Buccaneer",
"Burrito", "Burrito", "Bus", "Cabby", "Cavalcade", "Chavos", "Cognoscenti", "Comet", "Coquette",
"DF8", "Dilettante", "Dukes", "E109", "Emperor", "Emperor", "Esperanto", "Faction", "FBI", "Feltzer",
"Feroci", "Feroci", "Firetruck", "Flatbed", "Fortune", "Forklift", "Futo", "FXT", "Habanero", "Hakumai",
"Huntley", "Infernus", "Ingot", "Intruder", "Landstalker", "Lokus", "Manana", "Marbella", "Merit", "Minivan",
"Moonbeam", "MrTasty", "Mule", "Noose", "Nstockade", "Oracle", "Packer", "Patriot", "Perennial", "Perennial",
"Peyote", "Phantom", "Pinnacle", "PMP600", "Police", "Police", "Polpatriot", "Pony", "Premier", "Pres", "Primo",
"Pstockade", "Rancher", "Rebla", "Ripley", "Romero", "Rom", "Ruiner", "Sabre", "Sabre", "Sabre GT", "Schafter",
"Sentinel", "Solair", "Speedo", "Stalion", "Steed", "Stockade", "Stratum", "Stretch", "Sultan", "Sultan RS",
"Super GT", "Taxi", "Taxi", "Trash", "Turismo", "Uranus", "Vigero", "Vigero", "Vincent", "Virgo", "Voodoo",
"Washington", "Willard", "Yankee", "Bobber", "Faggio", "Hellfury", "NRG900", "PCJ600", "Sanchez", "Zombieb",
"Annihilator",  "Polmav", "Maverick","Tourmav", "Dinghy", "Jetmax", "Marquis", "Predator", "Reefer", "Squalo",
"Tuga", "Tropic", "Cablecar", "Subway", "Subway" ];